Skip to content

Ignore stdout & stderr logs and log warning #973

Merged
aphralG merged 5 commits intov3from
error-log-stdout-log-warning
Feb 10, 2025
Merged

Ignore stdout & stderr logs and log warning #973
aphralG merged 5 commits intov3from
error-log-stdout-log-warning

Conversation

@aphralG
Copy link
Contributor

@aphralG aphralG commented Feb 5, 2025

Proposed changes

Added stdout & stderr to ignore log list for access & error logs.
When log is being ignored warn user that config apply error log monitoring will not work.

time=2025-02-05T15:18:38.641Z level=WARN msg="Error logs output to stderr, error log monitoring
 during config apply not available. Log errors to file to enable error monitoring" 
error_log=stderr correlation_id="correlation_id=79b08b23-e3d4-11ef-9bb6-000c29109398"

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

@aphralG aphralG self-assigned this Feb 5, 2025
@aphralG aphralG requested a review from a team as a code owner February 5, 2025 15:32
@github-actions github-actions bot added the chore Pull requests for routine tasks label Feb 5, 2025
@aphralG aphralG requested a review from JTorreG February 5, 2025 15:43
Comment on lines 133 to 134
slog.WarnContext(ctx, fmt.Sprintf("Error log outputs to %s. Unable to monitor logs during "+
"config apply, log errors to file to enable error monitoring", directive.Args[0]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slog.WarnContext(ctx, fmt.Sprintf("Error log outputs to %s. Unable to monitor logs during "+
"config apply, log errors to file to enable error monitoring", directive.Args[0]),
slog.WarnContext(ctx, fmt.Sprintf("Currently error log outputs to %s. Log monitoring is disabled while "+
"applying a config; log errors to file to enable error monitoring", directive.Args[0]),

@aphralG aphralG requested a review from dhurley February 5, 2025 16:30
@aphralG aphralG merged commit 8b137c4 into v3 Feb 10, 2025
20 checks passed
@aphralG aphralG deleted the error-log-stdout-log-warning branch February 10, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Pull requests for routine tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants